NEW: Added Focus Events to Input Event Queue#2365
NEW: Added Focus Events to Input Event Queue#2365VeraMommersteeg wants to merge 26 commits intodevelopfrom
Conversation
…background device and all input goes to gameview are set
There was a problem hiding this comment.
This review identified several issues ranging from critical bugs in event handling to minor code cleanup items. The most significant concerns involve potential stale state during event processing and improper event discarding logic during focus changes in InputManager.cs, which could lead to stuck input states. Additionally, there are some minor performance improvements, concerns regarding profiler marker reliability, and several typos/commented-out code blocks in the test suite.
🤖 Helpful? 👍/👎
Codecov ReportAttention: Patch coverage is @@ Coverage Diff @@
## develop #2365 +/- ##
===========================================
+ Coverage 77.90% 78.11% +0.20%
===========================================
Files 476 482 +6
Lines 97613 98383 +770
===========================================
+ Hits 76048 76847 +799
+ Misses 21565 21536 -29 Flags with carried forward coverage won't be shown. Click here to find out more.
|
This comment was marked as off-topic.
This comment was marked as off-topic.
# Conflicts: # Packages/com.unity.inputsystem/InputSystem/InputManager.cs # Packages/com.unity.inputsystem/Tests/TestFixture/InputTestFixture.cs
|
@VeraMommersteeg Looks like the PR currently has conflicts that are in need of being resolved:
Likely due to CEPM/FEPM branch being merged. |
|
@VeraMommersteeg Noticed there are multiple test failures, I suspect you have already noticed and is looking into it? |
|
Yes Im aware I have changes to fix it locally |
ekcoh
left a comment
There was a problem hiding this comment.
Just commenting for now as a half-way review. Need to clone this PR in order to have a realistic chance to provide relevant feedback on InputManager.cs diff. Looking at the diff alone is very complex.
Packages/com.unity.inputsystem/InputSystem/LegacyInputManager.cs
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/InputSystem/InputManager.LegacyFocusHandling.cs
Show resolved
Hide resolved
Packages/com.unity.inputsystem/InputSystem/NativeInputRuntime.cs
Outdated
Show resolved
Hide resolved
|
Tested the current branch locally on 2022.3 and noticed the following:
|
This seems fine now after last batch of commits. |
|
Those tests are passing on CI though, when I was fixing some tests it ended up in a bad state, might want to restart editor and delete any generated files |
ekcoh
left a comment
There was a problem hiding this comment.
Thanks for doing this comprehensive work @VeraMommersteeg. Changes looks great and I couldn't spot anything that looks incorrect, but added some additional nitpick-level comments.
I like that legacy behaviour has been split out from InputManager since this was already partial that just simplifies removing legacy behaviour later.
I also like that you have added inline comments motivating complex behaviour in update loop (or indirect sub-parts of update), I also think its great you took some time to refactor / break up the update flow and its great you managed to keep many parts shared between legacy and new.
The only thing I would recommend checking either before or after this lands, would be to compare performance test results locally or in observer to check that the differences in event queue processing doesn't generate any performance regression. Functional correctness of course has higher priority, but we could negatively affect the update loop with these changes. IMO such performance issues should not prevent this from landing, but if we find anomalies we should likely try to address it. Great job!
Description
These are the managed changes for the package to introduce a focus event into the event buffer. It no longer listens to the Application.OnFocusChanged and instead changes focus based on the queued event from native. This will help us deal with desync focus state issues to make sure events are being processed in the right state.
Jira tickets:
ISX-2426
ISX-2427
Testing status & QA
Testing done:
Testing by QA:
Overall Product Risks
Comments to reviewers
I've spend some time cleaning up the OnUpdate a bit, didn't go too crazy and mostly just split up the code a bit in a couple of functions. But since the git diff makes it a bit difficult to see the changes, it might be easier to pull the branch and do a diff that way.
Checklist
Before review:
Changed,Fixed,Addedsections.Area_CanDoX,Area_CanDoX_EvenIfYIsTheCase,Area_WhenIDoX_AndYHappens_ThisIsTheResult.During merge:
NEW: ___.FIX: ___.DOCS: ___.CHANGE: ___.RELEASE: 1.1.0-preview.3.